<template>
	<view>
		<view class="item" @tap="handleDetail(item)">
			<view class="game_info">
				<image class="cover_img" :src="item.image" mode="aspectFill"></image>
				<view class="">
					<view class="title">{{ item.storeName }}</view>
					<view class="time">时间：{{ item.activityStartTime }}</view>
					<view class="join_count">
						<text>参与人数：</text>
						<text class="count_val">{{ item.stock || 0}}</text>
					</view>
				</view>
			</view>
			<view class="address">
				<uni-icons type="location-filled" color="#999" size="16"></uni-icons>
				<text>{{ item.address }}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"gameItem",
		props: {
			item: {
				type: Object,
				default: () => {
					return {}
				}
			},
			// 距离顶部高度
			// top: {
			// 	type: String || Number,
			// 	default: 120
			// },
		},
		data() {
			return {
				
			};
		},
		methods: {
			handleDetail(v){
				uni.navigateTo({
					url: `/pages/index/gameDetail/gameDetail?id=${v.id}`
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
.item {
	// width: 100%;
	padding: 20rpx 26rpx 26rpx;
	box-sizing: border-box;
	background-color: #fff;
	border-radius: 20rpx;
	// margin-bottom: 20rpx;
	position: relative;
	margin: 20rpx 27rpx;
	border: 1rpx solid #F7F7F7;

	.top_icon {
		width: 60rpx;
		height: 73rpx;
		position: absolute;
		top: 0;
		left: 26rpx;
		z-index: 2;
	}

	.game_info {
		display: flex;
		align-items: flex-start;
		padding-bottom: 14rpx;
		border-bottom: 1rpx dashed #F0F0F0;
		margin-bottom: 26rpx;

		.cover_img {
			width: 200rpx;
			height: 160rpx;
			border-radius: 14rpx;
			margin-right: 16rpx;
		}

		>view {
			flex: 1;

			.title {
				width: 420rpx;
				font-size: 30rpx;
				line-height: 30rpx;
				font-weight: bold;
				color: #1A1A1A;
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
			}

			.time {
				font-size: 24rpx;
				line-height: 24rpx;
				color: #999999;
				padding: 36rpx 0 22rpx;
			}

			.join_count {
				font-size: 24rpx;
				line-height: 24rpx;
				color: #999999;

				.count_val {
					color: #2E80FE;
					font-weight: bold;
				}
			}
		}
	}

	.address {
		display: flex;
		align-items: center;
		font-size: 24rpx;
		color: #999999;
	}
}
</style>